﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="msBsc.WebUi.wfBseDataSeekSetFinder" CodeBehind="wfBseDataSeekSetFinder.aspx.cs" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>系统业务条件配置管理</title>
    <link href="[dirDumm]/jqPlugin/jqTab/ui.tabs.css" rel="stylesheet" type="text/css" />

    <script src="[dirDumm]/jqPlugin/jqTab/ui.tabs.js" type="text/javascript"></script>

    <style type="text/css">
        html, body
        {
            overflow: hidden;
            margin-left: 0px;
            margin-top: 0px;
            margin-right: 0px;
            margin-bottom: 0px;
        }
    </style>

    <script type="text/javascript"> 
        //定义弹出编辑对话框字段变量
        var myDialogEditorCreater = new Sigma.DialogEditor({
            id: "myDialogEditor1",
            gridId: "myGrid1",
            width: 400,
            height: 270,
            title: 'Name Editor',
            body: ['<textarea id="my_name_input" rows="15" cols="20" style="width:98%"></textarea><br/>',
				'<center><input type="button" value="OK" onclick="Sigma.$grid(\'myGrid1\').activeDialog.confirm()"/></center>'].join(''),

            getValue: function () {
                return Sigma.$("my_name_input").value;
            },

            setValue: function (value) {
                Sigma.$("my_name_input").value = value;
            },
            active: function () {
//                debugger;
                Sigma.U.focus(Sigma.$("my_name_input"));
            }

        });
        //要自定义显示，比如链接等字段如下buynow,在renderer函数中返回要显示的HTML编码字符
        var colsOption = [
            { id: 'chk', isCheckColumn: true, filterable: false, exportable: false },
            { id: 'SEEK_SET_ID', hidden: true, filterable: false, exportable: false }, 
            { id: 'SEEK_NO', header: "条件编号", width: 80, editor: { type: 'text'} },
            { id: 'SEEK_NME', header: "条件说明", width: 120, editor: { type: 'text'} }, 
//            { id: 'VALUE_TYPE', header: "值类型", width: 100, editor: { type: "select", options: clopVALUE_TYPE, defaultText: '' }, renderer: clrdVALUE_TYPE },
            { id: 'VALUE_LIST_EXEC_SQL', header: "列表取数SQL", width: 220,toolTip: true, toolTipWidth: 150, editor: myDialogEditorCreater },
            { id: 'VALUE_LIST', header: "可选下拉列表", width: 220, toolTip: true, toolTipWidth: 150, editor: myDialogEditorCreater },
            { id: 'VALUE_LIST_FIELD', header: "显示字段列表", width: 220, toolTip: true, toolTipWidth: 150, editor: myDialogEditorCreater },
            { id: 'REMARKS', header: "备注", width: 220, toolTip: true, toolTipWidth: 150, editor: myDialogEditorCreater }, 
            { id: 'REC_ACTIVE', header: "是否审核", width: 100, editor: { type: "select", options: clopCheckBox
            , defaultText: 'False'
            }, renderer: clrdCheckBox
            } 
            ];
        function viewItem(sid) {
//            if (sid == "") {alert("请先保存！");return; }  OpenDialog(shUrlBase + "Bse/wfUserRoleDataRight.aspx?MODE=VIEW&R_ID=" + sid, null, null, "角色数据权限编辑");
        };
        //以下为固定的代码
        var gridOption1 = getGtOp('myGrid1', colsOption, 'gridbox1', 'SEEK_SET_ID');
        gridOption1.autoLoad = false;
        var mygrid1 = new Sigma.Grid(gridOption1);
        //////////////////////////////////////////////////////////
        function btnDo(sEbtn) {
            GtGrid1Action = sEbtn;
            var opart = GetGtParam("myGrid1");
            if (sEbtn == "mFinder") {
                doFinderGt('myGrid1');
            }
            else if (sEbtn == "btnEdit") {
                opart.AddCell("sEditMode", "EDIT");
                ajaxComm(opart, null, null, 'divCondition'); //调用页面回调，并传入参数
            }
            else if (sEbtn == "btnSave") {
                doSaveGt('myGrid1');
            }
            else if (sEbtn == "mAdd") {
//            OpenDialog(shUrlBase + "Bse/wfConstantEditor.aspx?MODE=ADD", null, null, "新增角色信息"); ;
            }
            else if (sEbtn == "btnConfirm" || sEbtn == "btnCancel") {
                var sidtem1 = GetGtSelectId('myGrid1');
                if (sidtem1) {
                    opart.AddCell("CHECK_ID", sidtem1);
                    ajaxComm(opart, null, null, 'divCondition'); //调用页面回调，并传入参数
                } else {
                    alert("请先选择记录！");
                }
            }
            else {
                ajaxComm(opart, null, null, 'divCondition'); //调用页面回调，并传入参数
            }
            GtGrid1Action = "";
        };
        function GetGtParam(jqGridID) {
            var _jsParam = new jsonRow();
            if (jqGridID == "myGrid1") {
                GetFormJson("divCondition", _jsParam);
                _jsParam.AddCell("PPAGE", "wfBseDataSeekSetFinder"); //这个地方是该页面的类名
                _jsParam.AddCell("gtGridID", "myGrid1");
                _jsParam.AddCell("sRadom", $("#sRadom").val());
                _jsParam.AddCell("txtStatus", $("#txtStatus").val());
                _jsParam.AddCell("ACTION", GtGrid1Action);
                //这里可增加传入后台的参数
            } return _jsParam;
        };
        $(window).load(function() {
            //初始化步进式搜索框
            $('#container2').fadeIn("fast"); //初始化TAB页选择控件
            $('#container2 ul').tabs();
            mygrid1.render();
            mygrid1.readOnly = true;
            autogtResize("bigbox2", mygrid1);
            SetBtnEnable('', 'btnEdit,btnSave,btnNotSave,btnConfirm,btnCancel');
        });
        function doTabChange(sStatus) {
            if (sStatus != $('#txtStatus').val()) {
                $('#txtStatus').val(sStatus); btnDo('mFinder');
            }
        };

    </script>

</head>
<body>
    <form id="wfBseDataSeekSetFinder" method="post" runat="server">
    <asp:HiddenField ID="sCombValueList" runat="server" Value="" />
    <asp:HiddenField ID="sSrcF" runat="server" />
    <div style="width: 100%; text-align: left; height: 75px; margin: 0px 0px 0px 0px;
        background-position: top; background-image: url([dirDumm]/images/bj.jpg); background-repeat: repeat-x;">
        <div id="container2" style="width: 100%; margin-top: 3px;display:none;">
            <ul>
                <li><a href="#fragment1" onclick="javascript:doTabChange('0');return false;"><span>
                    <img src="[dirDumm]/images/Gif16/Label0.gif" align="absmiddle" />
                    未确认</span></a> </li>
                <li><a href="#fragment1" onclick="javascript:doTabChange('1');return false;"><span>
                    <img src="[dirDumm]/images/Gif16/Label1.gif" align="absmiddle" />
                    已确认</span></a> </li>
                <li><a href="#fragment1" onclick="javascript:doTabChange('');return false;"><span>
                    <img src="[dirDumm]/images/Gif16/Label2.gif" align="absmiddle" />
                    所 有</span></a> </li>
            </ul>
            <div id="fragment1">
                <div id="divCondition" style="margin: 0px; border-style: solid; border-width: 1px;
                    border-color: #C8D2E0;">
                    <table border="0" cellpadding="0" cellspacing="0">
                        <tr> 
                            <td align="center">
                                <input type="button" onclick="javascript:btnDo('mFinder');return false;" value="查询(F)"
                                    id="btnFinder" accesskey="F" />
                                <input type="button" onclick="javascript:btnDo('btnEdit');return false;" value="编辑(E)"
                                    id="btnEdit" accesskey="E" />
                                <input type="button" onclick="javascript:btnDo('btnSave');return false;" value="保存(S)"
                                    id="btnSave" accesskey="S" />
                                <input type="button" onclick="javascript:btnDo('btnNotSave');return false;" value="取消(Z)"
                                    id="btnNotSave" accesskey="Z" /> 
                                <input type="button" onclick="javascript:btnDo('btnConfirm');return false;" value="确认(C)"
                                    id="btnConfirm" accesskey="C" />
                                <input type="button" onclick="javascript:btnDo('btnCancel');return false;" value="失效(L)"
                                    id="btnCancel" accesskey="L" />
                            </td>
                        </tr>
                    </table>
                </div>
                <div id="bigbox2" style="margin: 0px; margin-top: 2px;">
                    <div id="gridbox1" style="border: 0px solid #cccccc; background-color: #f3f3f3; padding: 5px;">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <asp:HiddenField ID="sRadom" runat="server" />
    <asp:HiddenField ID="txtStatus" runat="server" Value="0" />
    </form>
</body>
</html>